package com.lekang.system.service.impl;

import java.util.List;
import com.lekang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lekang.system.mapper.BalanceMapper;
import com.lekang.system.domain.Balance;
import com.lekang.system.service.IBalanceService;

/**
 * 余额查询Service业务层处理
 * 
 * @author 刘卓
 * @date 2025-10-14
 */
@Service
public class BalanceServiceImpl implements IBalanceService 
{
    @Autowired
    private BalanceMapper balanceMapper;

    /**
     * 查询余额查询
     * 
     * @param id 余额查询主键
     * @return 余额查询
     */
    @Override
    public Balance selectBalanceById(Long id)
    {
        return balanceMapper.selectBalanceById(id);
    }

    /**
     * 查询余额查询列表
     * 
     * @param balance 余额查询
     * @return 余额查询
     */
    @Override
    public List<Balance> selectBalanceList(Balance balance)
    {
        return balanceMapper.selectBalanceList(balance);
    }

    /**
     * 新增余额查询
     * 
     * @param balance 余额查询
     * @return 结果
     */
    @Override
    public int insertBalance(Balance balance)
    {
        return balanceMapper.insertBalance(balance);
    }

    /**
     * 修改余额查询
     * 
     * @param balance 余额查询
     * @return 结果
     */
    @Override
    public int updateBalance(Balance balance)
    {
        balance.setUpdateTime(DateUtils.getNowDate());
        return balanceMapper.updateBalance(balance);
    }

    /**
     * 批量删除余额查询
     * 
     * @param ids 需要删除的余额查询主键
     * @return 结果
     */
    @Override
    public int deleteBalanceByIds(Long[] ids)
    {
        return balanceMapper.deleteBalanceByIds(ids);
    }

    /**
     * 删除余额查询信息
     * 
     * @param id 余额查询主键
     * @return 结果
     */
    @Override
    public int deleteBalanceById(Long id)
    {
        return balanceMapper.deleteBalanceById(id);
    }
}
